package org.tity.sql.code;

import java.io.File;
 
import org.junit.Test;
import org.tity.commons.environment.ProjectInfo;
import org.tity.sql.dao.base.TableDataTest;
import org.tity.sql.entity.builder.EntityConfigBuilder;

/**
 * 生成一个实体配置文件
 * */
public class TestEntityConfigBuilder extends TableDataTest  {
 
 
	@Test
	public void build() {
		
		//在同级目录下生成一个示例文件
		File f=ProjectInfo.getMavenSourceDir(TestEntityConfigBuilder.class).resolve("config-base.json").file();
		EntityConfigBuilder cb=new EntityConfigBuilder(f) {
			@Override
			protected boolean isExcludeTable(String table) {
				if(!table.toLowerCase().startsWith("test_")) return true;
				return super.isExcludeTable(table);
			}
		};
		cb.setClassNameStartPartIndex(1);
		cb.build(dao,false);
		
	}

	 

	 

}
